package math;

import cn.hutool.core.util.NumberUtil;

public class MathTest {
    public static void main(String[] args) {
      /*  Long c=1l;//光速
       // String format = NumberUtil.decimalFormat(",###", c);//299,792,458

        String format = NumberUtil.toStr(c);//299,792,458
        StringBuilder stringBuilder = new StringBuilder();
        if(format.length()<4){
            int length = format.length();
            int count = (4-length);
            for (int i = 0; i < count ; i++) {
                stringBuilder.append("0");
            }
          //  System.out.println(stringBuilder);
        }
        //NumberUtil.toStr("");

        System.out.println(stringBuilder.append(format));*/

        System.out.println(addPrefex(11111l, 6, "0"));
    }


    public static String addPrefex(Long c ,int maxLength ,String prefex) {

        String format = NumberUtil.toStr(c);
        StringBuilder stringBuilder = new StringBuilder();
        if(format.length()< maxLength){
            int length = format.length();
            int count = ( maxLength-length);
            for (int i = 0; i < count ; i++) {
                stringBuilder.append(prefex);
            }

        }

        return stringBuilder.append(format).toString();
    }

}
